//
//  HYQImagePickerManager.h
//  HYQImagePickerController_Example
//
//  Created by zhuxingjian on 2018/8/28.
//  Copyright © 2018年 zxj1989. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>

typedef NS_ENUM(NSInteger, HYQImagePickerType) {
    HYQImagePickerTypeSinglePhoto = 0,          //选择单张图片
    HYQImagePickerTypeSingleVideo,              //选择单个视频
    HYQImagePickerTypeOnlyPhoto,                //只可以选择图片
    HYQImagePickerTypeOnlyVideo,                //只可以选择视频
    HYQImagePickerTypemultiple                  //可以选择视频或图片，选择图片后不可以选择视频，视频只能单选
};

@interface HYQImagePickerManager : NSObject

@property (nonatomic, weak) UIViewController *sceneViewController;

- (instancetype)initPickerWithType:(HYQImagePickerType)type;

- (instancetype)initPreviewPhotoPickerWithType:(HYQImagePickerType)type
                                selectedAssets:(NSMutableArray *)selectedAssets
                                selectedPhotos:(NSMutableArray *)selectedPhotos
                                  currentIndex:(NSInteger)index;

- (instancetype)initPreviewVideoControllerWithAsset:(PHAsset *)asset;

- (instancetype)initWithTakePhotoViewController;

/**
 已经选中的assets数组
 */
@property (nonatomic, strong) NSMutableArray *selectedAssets;

/**
 可选择视频的时长，如果可以录制，包括录制视频的时长限制,默认300s
 */
@property (nonatomic, assign) NSTimeInterval videoMaxDuration;

/**
 可选图片数量
 */
@property (nonatomic, assign) NSInteger maxImageSelecteCount;

/**
 是否显示拍照/录制视频入口 等同于设置allowTakeVideo = NO 和 allowTakePicture = NO; 默认NO
 */
@property (nonatomic, assign) BOOL showCamera;

/**
 是否允许选择原图，默认NO
 */
@property (nonatomic, assign) BOOL isAllowSelectOriginalPhoto;

/**
 预览活再次选中时是否选中原图，默认NO
 */
@property (nonatomic, assign) BOOL isSelectOriginalPhoto;

/**
 是否需要裁剪：单张选择时生效
 */
@property (nonatomic, assign) BOOL needCrop;
/**
 裁剪宽高比例，只有allowCrop为YES时生效
 */
@property (nonatomic, assign) CGFloat cropScale;

@property (nonatomic, copy) void(^didPickPhotosBlock)(NSArray *selectedAssets, NSArray *thumbImages, BOOL isSelectOriginalPhoto);

@property (nonatomic, copy) void(^didPickCropPhotoBlock)(PHAsset *asset, UIImage *cropImage);

@property (nonatomic, copy) void(^didPickVideoBlock)(PHAsset *asset, UIImage *coverImage);

@property (nonatomic, copy) void(^didCancelPickBlock)();

- (void)showImagePickerAnimated:(BOOL)animated;

@end
